from tkinter import *

''' root = Tk()

root.title("登录")
root.geometry("300x300")

Label(root, text="账号").grid(row=0, column=0)
Entry(root).grid(row=0, column=1)
Label(root, text="密码").grid(row=1, column=0)
Entry(root, show="*").grid(row=1, column=1)         # 密码输入设置为*号

Button(root, text="提交").grid(row=2, column=1)

root.mainloop() '''


# 获取输入值
root = Tk()

root.title("登录")
root.geometry("300x300")

Label(root, text="账号").grid(row=0, column=0)
e1 = Entry(root)
e1.grid(row=0, column=1)

Label(root, text="密码").grid(row=1, column=0)
e2 = Entry(root, show="*")
e2.grid(row=1, column=1)

def submit():
  lb1 = Label(root, text = "账号是：%s" % e1.get())
  lb1.grid(row=4, column=1)
  lb2 = Label(root, text = "密码是：%s" % e2.get())
  lb2.grid(row=5, column=1)

Button(root, text="提交", command=submit).grid(row=2, column=1)

root.mainloop()


